package com.itheima.neibulei;

public class Demo01 {

    public static void main(String[] args) {
        Outer outer = new Outer();
        System.out.println(outer.i);
        outer.sing();
        //类名  对象名 = new 类名();
        Outer.Inner inner = outer.new Inner();
        System.out.println(inner.j);
        inner.dance();

        //外部类名.内部类名 对象名 = new 外部类名().new 内部类名();
        Outer.Inner inner1 = new Outer().new Inner();

    }
}
class Outer{
    int i=10;
    public void sing(){
        System.out.println(i);
        System.out.println("唱");
        Inner inner = new Inner();
        System.out.println(inner.j);
        inner.dance();
    }
    // 内部类
    class Inner {
        int j=20;
        public void dance(){
            System.out.println(i);
            System.out.println("跳");
        }
    }
}
